﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Utility.Json;

namespace MsgCenter.Web.Handlers
{
    public class WS_Send
    {
        public static JsonRetData WS_SendMessge(string strMessageID, string strApplicationCode, string strTempletNo,
            string[] strMessage, string strReceiveLoginName, string strSendIP)
        {
            JsonRetData json = null;
            try
            {
                string strLogMessage = "strMessageID:" + strMessageID + "      strApplicationCode:" + strApplicationCode + "      strTempletNo:" + strTempletNo + "      strReceiveLoginName:" + strReceiveLoginName;
                Utility.Log.LogHelper.WriteLog(strLogMessage);
                json = BLL.BLLServiceHelper.GetWriteService().WS_SendMessge(strMessageID, strApplicationCode, strTempletNo, strMessage, strReceiveLoginName, strSendIP);
                Utility.Log.LogHelper.WriteLog(json.AssemblyJson());
            }
            catch (Exception ex)
            {
                json = new JsonRetData();
                json.State = "false";
                json.Message = "发送失败：" + ex.Message;
                Utility.Log.LogHelper.WriteError(json.AssemblyJson(), ex);
            }
            return json;
        }

        public static JsonRetData WS_SendMessge_Mobile(string strMessageID, string strApplicationCode, string strTempletNo,
            string[] strMessage, string strSendIP, string strMobile)
        {
            JsonRetData json = null;
            try
            {
                string strLogMessage = "strMessageID:" + strMessageID + "      strApplicationCode:" + strApplicationCode + "      strTempletNo:" + strTempletNo + "      strMobile:" + strMobile;
                Utility.Log.LogHelper.WriteLog(strLogMessage);
                json = BLL.BLLServiceHelper.GetWriteService().WS_SendMessge_Mobile(strMessageID, strApplicationCode, strTempletNo, strMessage, strMobile, strSendIP);
                Utility.Log.LogHelper.WriteLog(json.AssemblyJson());
            }
            catch (Exception ex)
            {
                json = new JsonRetData();
                json.State = "false";
                json.Message = "发送失败：" + ex.Message;
                Utility.Log.LogHelper.WriteError(json.AssemblyJson(), ex);
            }
            return json;
        }



        public static JsonRetData WS_SendMessge_Role(string strMessageID, string strApplicationCode, string strTempletNo,
            string[] strMessage, string strSendIP, string strMobile)
        {
            JsonRetData json = null;
            try
            {
                string strLogMessage = "strMessageID:" + strMessageID + "      strApplicationCode:" + strApplicationCode + "      strTempletNo:" + strTempletNo + "      strMobile:" + strMobile;
                Utility.Log.LogHelper.WriteLog(strLogMessage);
                json = BLL.BLLServiceHelper.GetWriteService().WS_SendMessge_Role(strMessageID, strApplicationCode, strTempletNo,
                    strMessage, strMobile, strSendIP);
                Utility.Log.LogHelper.WriteLog(json.AssemblyJson());
            }
            catch (Exception ex)
            {
                json = new JsonRetData();
                json.State = "false";
                json.Message = "发送失败：" + ex.Message;
                Utility.Log.LogHelper.WriteError(json.AssemblyJson(), ex);
            }
            return json;
        }

    }
}